﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Reporting.WebForms;
using System.Configuration;

namespace FONCREAGROINTEGRAL.Reporting.RRHH
{
    public partial class AFPArea : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string IdEjercicioMes = Convert.ToString(Request.QueryString["IdEjercicioMes"]);
                //string IdTipoTrabajador = Convert.ToString(Request.QueryString["IdTipoTrabajador"]);

                var reportServer = ConfigurationManager.AppSettings["ReportServer"].ToString();
                rptAFPArea.ProcessingMode = ProcessingMode.Remote;
                rptAFPArea.ServerReport.ReportServerUrl = new Uri(reportServer);
                //rptAFPArea.ServerReport.ReportPath = "/RRHH/AFPArea";
                rptAFPArea.ServerReport.ReportPath = "/RRHH/Rpt/AFPArea";

                rptAFPArea.ShowPrintButton = true;
                rptAFPArea.ShowParameterPrompts = false;
                ReportParameter[] param = new ReportParameter[1];
                param[0] = new ReportParameter("IdEjercicioMes", IdEjercicioMes);
                //param[1] = new ReportParameter("IdTipoTrabajador", IdTipoTrabajador);
                rptAFPArea.ServerReport.SetParameters(param);

                rptAFPArea.ServerReport.Refresh();
            }
        }
    }
}